//
//  LTView.m
//  UI_03LTView
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LTView.h"

@interface LTView () <UITextFieldDelegate>

//@property (nonatomic, retain)UILabel *label;
//@property(nonatomic,retain)UITextField *textField;
//

@end





@implementation LTView

-(void)dealloc{
    [_label release];
    [_textField release];
    [super dealloc];
}


-(instancetype)initWithFrame:(CGRect)frame withLabelText:(NSString *)labelText withTextField:(NSString *)textField
{
    self = [super initWithFrame:frame];
   
    if (self) {
        
        self.label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width / 3, self.frame.size.height) ];
        self.label.text = labelText;
        self.textField = [[UITextField alloc]initWithFrame:CGRectMake(self.frame.size.width / 3 + 15, 0, self.frame.size.width / 3 * 2, self.frame.size.height - 8) ];
        self.textField.placeholder = textField;
        self.textField.borderStyle = 3;
        self.textField.delegate = self;
        
        [self addSubview:_label];
        [self addSubview:_textField];
    }
    return self;
}


-(BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return YES;
}





@end
